package com.attendance.www.hr.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import com.attendance.www.hr.dao.mapper.MainJobsVersionMapper;
import com.attendance.www.hr.entitys.MainJobsVersion;
import com.attendance.www.hr.entitys.MainJobsVersionExample;
import com.attendance.www.hr.service.IMainJobsVersionService;

@Service
public class MainJobsVersionServiceImpl implements IMainJobsVersionService {
	@Resource
	private MainJobsVersionMapper mainJobsVersionDao;

	/**
	 * 查询
	 */
	@Override
	public List<MainJobsVersion> getMainJobsVersionList() {
		List<MainJobsVersion> mainJobsVersionList = mainJobsVersionDao.selectByExample(new MainJobsVersionExample());
		return mainJobsVersionList;
	}

	/**
	 * 增加
	 */
	@Override
	public void saveMainJobsVersion(List<MainJobsVersion> mainJobsVersionList) {
		for (int i = 0; i < mainJobsVersionList.size(); i++) {
			mainJobsVersionDao.insertSelective(mainJobsVersionList.get(i));
		}

	}

	/**
	 * 删除
	 */
	@Override
	public boolean deleteMainJobsVersion() {
		if (mainJobsVersionDao.deleteByExample(new MainJobsVersionExample()) > 0) {
			return true;
		}
		return false;

	}
}
